<template>
  <div>
    <el-card class="box-card">
      <h3>新建楼座</h3>
    </el-card>
    <el-card style="margin-top: 20px">
      <span>基础信息</span>
      <div>
        <el-form
          label-position="right"
          label-width="80px"
          :model="forms"
          style="width: 400px; margin-left: 200px; margin-top: 40px"
        >
          <el-form-item label="楼座名称">
            <el-input v-model="forms.howMany"></el-input>
          </el-form-item>
          <el-form-item label="房屋用途">
            <!-- <el-input v-model="forms.houseUse"></el-input> -->
             <el-select
                v-model="forms.houseUse"
                clearable
                placeholder="请选择"
              >
                <el-option label="普通住宅" value="普通住宅"></el-option>
                <el-option label="商业用地" value="商业用地"></el-option>
                <el-option label="商住两用" value="商住两用"></el-option>
              </el-select>
          </el-form-item>
          <el-form-item label="建成日期">
            <el-date-picker
      v-model="forms.builtTime"
      type="datetime"
      placeholder="选择日期时间"
      value-format="yyyy-MM-dd HH:mm:ss"
      >
    </el-date-picker>
            <!-- <el-input v-model="formLabelAlign.type"></el-input> -->
          </el-form-item>
          <el-form-item label="楼层数量">
             <el-input-number v-model="forms.totalFloor" @change="handleChange" :min="1" :max="30"> 
             </el-input-number>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="forms.remark"></el-input>
          </el-form-item>
        </el-form>
        <div style="margin-left:350px">
        <el-button type="primary" @click="addCommunitys" >提交</el-button>
        <el-button style="margin-left:50px" type="primary">重置</el-button>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      forms: {
        howMany:'',
        houseUse: "",
        builtTime: "",
        buildingSum: "",
        totalFloor:"",
        remark:"",
        communityId:"",
      },
      
    };
  },
  methods:{
    addCommunitys(){
      this.forms.communityId= localStorage.getItem("communityId")
      console.log(this.forms);
      this.$axios.post("/housingestate/building/addCommunityPc",this.forms).then((res)=>{
         this.$router.push({
           path:"/community"
         })
      })
    }
  }
};
</script>

<style scoped>
</style>